import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import LayoutVue from '../components/Layout.vue'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'index',
        component: LayoutVue,
        redirect: '/clinic/list',
        children: [
            {
                path: "/clinic/list",
                component: () => import(/* webpackChunkName: "clinic" */ '../view/ClinicView.vue')
            },
            {
                path: "/clinic/doctor",
                component: () => import(/* webpackChunkName: "doctor" */ '../view/DoctorView.vue')
            },
            {
                path: "/clinic/bill",
                component: () => import(/* webpackChunkName: "clinic" */ '../view/BillView.vue')
            },
            {
                path: "/clinic/policy",
                component: () => import(/* webpackChunkName: "doctor" */ '../view/PolicyView.vue')
            },
            {
                path: '/clinic/add1',
                component: () => import(/* webpackChunkName: "doctor" */ '../view/Add1View.vue')
            },
            {
                path: '/clinic/edit',
                component: () => import(/* webpackChunkName: "doctor" */ '../view/Add1View.vue')
            },
            {
                path: '/clinic/add2',
                component: () => import(/* webpackChunkName: "doctor" */ '../view/Doctoradd.vue')
            },
            {
                path: '/clinic/edit2',
                component: () => import(/* webpackChunkName: "doctor" */ '../view/Doctoradd.vue')
            },
            {
                path: '/clinic/add3',
                component: () => import(/* webpackChunkName: "doctor" */ '../view/Billadd.vue')
            }
        ]
    },
    {
        path: "/charts",
        component: () => import(/* webpackChunkName: "charts" */ '../view/ChartsView.vue')
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
